<include file="Public/common" />
<block name="css">
    <icheckcss/>
</block>
<block name="content">
    <div class="page-header"><h1><i class="fa fa-home"></i> 首页 &gt; 后台管理 &gt; 修改员工</h1></div>
    <div class="col-xs-12">
        <div class="tabbable">
            <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab">
                <li><a href="{:U('Rule/admin_user_list')}">员工列表</a></li>
                <li class="active"><a href="{:U('Rule/add_admin')}">修改员工</a></li>
            </ul>
            <div class="tab-content">
                <form class="form-inline" method="post"><input type="hidden" name="id" value="{$user_data['operator_id']}">
                    <table class="table table-striped table-bordered table-hover table-condensed">
                        <tr>
                            <th>管理组</th>
                            <td>
                                <foreach name="data" item="v">
                                    {$v['title']}
                                    <input class="xb-icheck" type="radio" name="group_ids[]" value="{$v['id']}"
                                    <in name="v['id']" value="$group_data"> checked="checked"</in>  >
                                </foreach>
                            </td>
                        </tr>
                        <tr>
                            <th>登录帐号</th>
                            <td><input class="input-medium" type="text" name="operator_account"
                                       value="{$user_data['operator_account']}"></td>
                        </tr>
                        <tr>
                            <th>姓名</th>
                            <td><input class="input-medium" type="text" name="operator_name"
                                       value="{$user_data['operator_name']}"></td>
                        </tr>
                        <tr>
                            <th>手机号</th>
                            <td><input class="input-medium" type="text" name="operator_phone" value="{$user_data['operator_phone']}"></td>
                        </tr>

                        <tr>
                            <th>初始密码</th>
                            <td><input class="input-medium" type="text" name="loginPwd">如不改密码；留空即可</td>
                        </tr>

                        <tr>
                            <th>性别</th>
                            <td><span class="inputword">男</span> <input class="xb-icheck" type="radio" name="operator_gender" value="1" <if condition="$user_data['operator_gender'] eq 1">checked="checked"</if> >
                                <span class="inputword">女</span> <input class="xb-icheck" type="radio" name="operator_gender" value="2" <if condition="$user_data['operator_gender'] eq 2">checked="checked"</if> >
                            </td>
                        </tr>
                        <tr>
                            <th>备注</th>
                            <td>
                                <textarea name="remark" class="form-control" id="" cols="30" rows="5">{$user_data['remark']}</textarea>
                            </td>
                        </tr>
                        <tr >
                            <th>是否门店</th>
                            <td>
                                <select name="is_store" id="is_store">
                                    <option <if condition="$user_data['is_store'] eq '0'">selected</if> value="0">否</option>
                                    <option <if condition="$user_data['is_store'] eq '1'">selected</if> value="1">是</option>
                                </select>
                            </td>
                        </tr>
                        <tr  id="is_store_tr" <if condition="!$user_data['is_store']"> style="display:none;"</if> >
                             <th>门店名称</th>
                            <td><input class="input-medium" type="text" name="store_name" value="{$user_data['store_name']}"></td>
                        </tr>
                        <tr>
                            <th>状态</th>
                            <td><span class="inputword">允许登录</span> <input class="xb-icheck" type="radio" name="operator_status"
                                                                           value="1"
                                <eq name="user_data['operator_status']" value="1"> checked="checked"</eq>
                                > &emsp; <span class="inputword">禁止登录</span> <input class="xb-icheck" type="radio"
                                                                                    name="operator_status" value="0"
                                <eq name="user_data['operator_status']" value="0"> checked="checked"</eq>
                                >
                            </td>
                        </tr>
                        <tr>
                            <th></th>
                            <td><input class="btn btn-success" type="submit" value="修改"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
</block>
<block name="js">
    <script>
        $('body').on('change','#is_store',function () {
            var isCheck=$(this).val();
            if(isCheck==1){
                $('#is_store_tr').show();
            }else{
                $('#is_store_tr').hide();
            }
        })
    </script>
</block>